package com.levtech.moviemanager.loan;

import com.levtech.moviemanager.contact.Contact;
import com.levtech.moviemanager.movie.Movie;

public class Loan
{
	private Movie movie;
	private Contact contact;
	private String startDate;
	private String endDate;
	private String status;
	
	public Loan(Movie movie, Contact contact, String start, String end, String status)
	{
		this.movie = movie;
		this.contact = contact;
		this.startDate = start;
		this.endDate = end;
		this.status = status;
	}

	public Movie getMovie()
	{
		return movie;
	}

	public Contact getContact()
	{
		return contact;
	}

	public String getStartDate()
	{
		if(startDate.equals(""))
			return null;
		return startDate;
	}

	public String getEndDate()
	{
		if(endDate.equals(""))
			return null;
		return endDate;
	}

	public String getStatus()
	{
		if(status.equals(""))
			return null;
		return status;
	}

	public void setMovie(Movie movie)
	{
		this.movie = movie;
	}

	public void setContact(Contact contact)
	{
		this.contact = contact;
	}

	public void setStartDate(String startDate)
	{
		this.startDate = startDate;
	}

	public void setEndDate(String endDate)
	{
		this.endDate = endDate;
	}

	public void setStatus(String status)
	{
		this.status = status;
	}
	
	@Override
	public String toString()
	{
		return //"Movie: " + this.movie.getTitle() +
				"Contact: " + this.contact.getFirstName() + " " + this.contact.getLastName() +
				"\nDates: " + this.startDate + " - " + this.endDate +
				"\nStatus: " + this.status;
	}

}
